import request from '../utils/request'

export const getArticles = params => request({
    url: '/v1_0/articles',
    params
})

export const getArticlesById = articleId => request({
    url: `/v1_0/articles/${articleId}`
})

export const addCollect = target => request({
    method: "POST",
    url: '/v1_0/article/collections',
    data: {
        target
    }
})

export const deleteCollect = target => request({
    method: 'DELETE',
    url: `/v1_0/article/collections/${target}`
})

export const addLike = target => request({
    method: 'POST',
    url: '/v1_0/article/likings',
    data: {
        target
    }
})

export const deleteLike = target => request({
    method: 'DELETE',
    url: `/v1_0/article/likings/${target}`
})